/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Splash.java
 *
 * Created on 03/10/2009, 14:17:13
 */

package splash;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author zxero
 */
public class Splash extends javax.swing.JFrame implements Runnable{

    /** Creates new form Splash */
    public Splash() {
        initComponents();
    }

    Thread t;
    @SuppressWarnings("static-access")
    public void run () {
      try{
            for (int i=0; i<=100 ;i=i+3){
       if (i==3) {
                 this.setLocationRelativeTo(null);
             }
            t.sleep((100));
            this.setVisible(true);
            if (i==93){
                barra.setForeground(new java.awt.Color(0,204,0));
                }
                barra.setValue(i);
              }
            
      } catch (InterruptedException ex) {
            Logger.getLogger(Splash.class.getName()).log(Level.SEVERE, null, ex);
        }
              this.dispose();
     new ventana().setVisible(true);
         
  }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        barra = new javax.swing.JProgressBar();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();

        jLabel1.setBackground(new java.awt.Color(0, 0, 0));
        jLabel1.setForeground(new java.awt.Color(51, 51, 51));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/operaciones/WaterSplash.jpg"))); // NOI18N

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBackground(new java.awt.Color(0, 0, 0));
        setMinimumSize(new java.awt.Dimension(490, 280));
        setUndecorated(true);
        getContentPane().setLayout(null);

        barra.setFont(new java.awt.Font("DejaVu Sans", 1, 12)); // NOI18N
        barra.setForeground(java.awt.Color.blue);
        barra.setStringPainted(true);
        getContentPane().add(barra);
        barra.setBounds(10, 210, 520, 20);

        jLabel2.setText("ACA VA LO QUE SE ESTA CARGANDO...");
        getContentPane().add(jLabel2);
        jLabel2.setBounds(10, 180, 320, 20);

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 48)); // NOI18N
        jLabel3.setText("VALE POR UNA IMAGEN");
        getContentPane().add(jLabel3);
        jLabel3.setBounds(20, 20, 500, 130);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Splash().setVisible(true);
                
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JProgressBar barra;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    // End of variables declaration//GEN-END:variables

}
